<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>继承</title>
	</head>
	<body>
		<p>ECMAscript只支持继承，不支持接口，而实现继承的方式依靠原型链完成</p>
	</body>
	<script>
		//简单实现
		
		function Box(){  //Box构造
			this.name ='lee';
		}
		function Desk(){//Desk构造
			
			this.age =100;
		}
		Desk.prototype = new Box();//Desk 继承了Box,通过原型形，成链条
		
		var desk = new Desk();
		alert(desk.age);
		alert(desk.name);//得到被继承的属性
	
	 function Table(){    //Table构造
	 	this.level ='SSS';
	 }
	 Table.prototype = new Desk();//继承原型链继承
	</script>
</html>
